package QHgui.docing;

import QHgui.QHMainFrame;
import SingleService.SingleInstance;
import SingleService.SingleInstanceKey;
import com.javadocking.dockable.Dockable;
import com.javadocking.dockable.DockableState;
import com.javadocking.dockable.action.DockableStateAction;

import javax.swing.*;
import java.awt.event.ActionEvent;

/**
 * <p> TODU </P>
 *
 * @author yeager
 * @Version V1.1.1.0
 * @date 2023/11/24 10:30
 */
public class SCloseDockableStateAction  extends AbstractAction implements DockableStateAction {
    private Dockable 	dockable;
    public SCloseDockableStateAction(Dockable dockable,Icon icon)
    {
        super("Close",icon);
        this.dockable=dockable;
    }
    @Override
    public void actionPerformed(ActionEvent arg0) {
        // TODO Auto-generated method stub
        QHMainFrame mf=(QHMainFrame) SingleInstance.getInstance(SingleInstanceKey.MainFrame);
        //mf.getWorkingPanel().closeDockable(dockable);
    }

    @Override
    public Dockable getDockable() {
        // TODO Auto-generated method stub
        return dockable;
    }

    @Override
    public int getNewDockableState() {
        // TODO Auto-generated method stub
        return DockableState.CLOSED;
    }

}
